﻿<%@ Page Title="" Language="C#" MasterPageFile="~/mpTaskPanel.Master" AutoEventWireup="true"
    CodeBehind="Uploader.aspx.cs" Inherits="WebUI.FilesUploader.Uploader" Theme="Default" %>

<%@ MasterType VirtualPath="~/mpTaskPanel.master" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        .groupHeader
        {
            font-size: 1.2em;
            color: White;
        }
        input[type=text]
        {
            color: #244368;
            background-color: #F1F5FA;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="HeaderPlace" runat="server">
    קבצים נלווים
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlace" runat="server">
    <div class="groupHeader">
        <asp:Label ID="lblLayerPath" runat="server" />
    </div>
    <div class="group" style="max-height: 300px; overflow: auto">
        <asp:Repeater ID="FileList" runat="server" OnItemCommand="OnFileListCommand" EnableViewState="true">
            <ItemTemplate>
                <div class="listItem" style="max-width: 225px">
                    <table class="group" cellpadding="0" cellspacing="0" style="width: 100%; margin: 3px">
                        <tr>
                            <td class="row1" colspan="2">
                                <input type="text" disabled="disabled" value='<%# Eval("FileName") %>' />
                            </td>
                        </tr>
                        <tr>
                            <td rowspan="3" class="row1" style="width: 32px; text-align: center">
                                <asp:Image ID="imgFileIcon" runat="server" Width="32px" Height="32px" ImageUrl='<%# Eval("FileIcon", "~/Images/FileIcons/{0}") %>' />
                            </td>
                            <td class="row2">
                                <asp:Label ID="lblDescription" runat="server" Text='<%# Eval("Description") %>' />
                                <asp:Panel ID="FileEditPanel" runat="server" Visible="false">
                                    <asp:TextBox ID="txtDescriptionUpdate" runat="server" TextMode="MultiLine" Height="30px"
                                        Text='<%# Eval("Description") %>' />
                                    <asp:ImageButton ID="btnUpdate" runat="server" CommandName="Update" CommandArgument='<%# Eval("ID") %>'
                                        Width="16px" Height="16px" ImageUrl="~/Images/OK.png" AlternateText="אישור" />
                                    <asp:ImageButton ID="btnCancel" runat="server" CommandName="Cancel" CommandArgument='<%# Eval("ID") %>'
                                        Width="16px" Height="16px" ImageUrl="~/Images/Delete.png" AlternateText="ביטול" />
                                </asp:Panel>
                            </td>
                        </tr>
                        <tr>
                            <td class="row1">
                                <%# Eval("UploadDate") %>
                            </td>
                        </tr>
                        <tr>
                            <td class="row2" style="text-align: left">
                                <a href="<%# Eval("FileUrl") %>" target="_blank">
                                    <asp:Image ID="imgDownload" runat="server" Width="16px" Height="16px" ImageUrl="~/Images/download.png"
                                        AlternateText="הורדת קובץ" /></a>
                                <asp:ImageButton ID="btnEdit" runat="server" CommandName="Edit" CommandArgument='<%# Eval("ID") %>'
                                    Width="16px" Height="16px" ImageUrl="~/Images/edit.png" AlternateText="עדכון תאור" />
                                <asp:ImageButton ID="btnDelete" runat="server" CommandName="Delete" CommandArgument='<%# Eval("ID") %>'
                                    Width="16px" Height="16px" ImageUrl="~/Images/delete.png" AlternateText="הסרת קובץ"
                                    OnClientClick="return confirm('לא תהיה אפשרות לשחזר נתונים. ברצונך להמשיך?')" />
                            </td>
                        </tr>
                    </table>
                </div>
            </ItemTemplate>
            <AlternatingItemTemplate>
                <div class="altListItem" style="max-width: 225px">
                    <table class="group" cellpadding="0" cellspacing="0" style="width: 100%; margin: 3px">
                        <tr>
                            <td class="row1" colspan="2">
                                <input type="text" disabled="disabled" value='<%# Eval("FileName") %>' />
                            </td>
                        </tr>
                        <tr>
                            <td rowspan="3" class="row1" style="width: 32px; text-align: center">
                                <asp:Image ID="imgFileIcon" runat="server" Width="32px" Height="32px" ImageUrl='<%# Eval("FileIcon", "~/Images/FileIcons/{0}") %>' />
                            </td>
                            <td class="row2">
                                <asp:Label ID="lblDescription" runat="server" Text='<%# Eval("Description") %>' />
                                <asp:Panel ID="FileEditPanel" runat="server" Visible="false">
                                    <asp:TextBox ID="txtDescriptionUpdate" runat="server" TextMode="MultiLine" Height="30px"
                                        Text='<%# Eval("Description") %>' />
                                    <asp:ImageButton ID="btnUpdate" runat="server" CommandName="Update" CommandArgument='<%# Eval("ID") %>'
                                        Width="16px" Height="16px" ImageUrl="~/Images/OK.png" AlternateText="אישור" />
                                    <asp:ImageButton ID="btnCancel" runat="server" CommandName="Cancel" CommandArgument='<%# Eval("ID") %>'
                                        Width="16px" Height="16px" ImageUrl="~/Images/Delete.png" AlternateText="ביטול" />
                                </asp:Panel>
                            </td>
                        </tr>
                        <tr>
                            <td class="row1">
                                <%# Eval("UploadDate") %>
                            </td>
                        </tr>
                        <tr>
                            <td class="row2" style="text-align: left">
                                <a href="<%# Eval("FileUrl") %>" target="_blank">
                                    <asp:Image ID="imgDownload" runat="server" Width="16px" Height="16px" ImageUrl="~/Images/download.png"
                                        AlternateText="הורדת קובץ" /></a>
                                <asp:ImageButton ID="btnEdit" runat="server" CommandName="Edit" CommandArgument='<%# Eval("ID") %>'
                                    Width="16px" Height="16px" ImageUrl="~/Images/edit.png" AlternateText="עדכון תאור" />
                                <asp:ImageButton ID="btnDelete" runat="server" CommandName="Delete" CommandArgument='<%# Eval("ID") %>'
                                    Width="16px" Height="16px" ImageUrl="~/Images/delete.png" AlternateText="הסרת קובץ"
                                    OnClientClick="return confirm('לא תהיה אפשרות לשחזר נתונים. ברצונך להמשיך?')" />
                            </td>
                        </tr>
                    </table>
                </div>
            </AlternatingItemTemplate>
        </asp:Repeater>
    </div>
    <div class="group" style="margin-top: 1em; display: block">
        <div class="groupHeader">
            טעינת קובץ</div>
        <div class="row1">
            <div class="label">
                בחר קובץ</div>
            <asp:FileUpload ID="fileUpload" runat="server" BackColor="#A9C1E0" />
        </div>
        <div class="row2">
            <div class="label">
                תאר את הקובץ</div>
            <asp:TextBox ID="txtDescription" runat="server" TextMode="MultiLine" Height="30px" />
        </div>
        <asp:Button ID="btnUpload" runat="server" Text="בצע" OnClick="UploadFile" />
    </div>
</asp:Content>
